# 符号输出
str1 = '100'
myfloat = 12.03
isflag = True

mytuple = (20,30,40)
mylist = [10,20,30]
# int 将字符串|浮点数|布尔值 转化成整数


print(type(int(str1)))
print(type(int(myfloat)), int(myfloat))
print(type(int(isflag)), int(isflag))



# float 将字符串,整数,布尔值,转化成浮点数
print(type(float(str1)), float(str1))
print(type(float(isflag)), float(isflag))
# 不能转化list 和tupl argument must be a string, a bytes-like object or a number
# print(type(int(list)), int(list))


# str 可以将任何的数据转化
print(type(str(mytuple)),str(mytuple))

print(type(str(mylist)),str(mylist))
# tuple  将 set 和list 转化成元组
print(type(tuple(mylist)),tuple(mylist))
# list 将tuple 和set 转化成列表
print(type(list(mytuple)),list(mytuple))


# eval将字符串中有效的 Python表达式变成对象
slist = '["张三","李四"]'
stuple = '("王五","溜溜")'

print(type(eval(slist)),eval(slist))
print(type(eval(stuple)),eval(stuple))